<template>
	<view class="bh-list-wrapper">
		<div class="loading" v-if="postList===''">加载中...</div>
		<div class="empty" v-else-if="postList.length===0">
			<image v-if="type==='post'" src="/static/empty-post.png" mode=""></image>
		</div>
		<div v-else>
			<slot></slot>
		</div>
		<div class="loading" v-if="continueState==='show'">继续努力加载中...</div>
		<div class="loading" v-if="continueState==='finish'">---已经到底了---</div>
		<div class="loading" v-if="continueState==='hide'">---hide---</div>
	</view>
</template>

<script>
	export default {
		name: "bh-list",
		props: {
			postList: { // 帖子列表
				required: true,
				default: ''
			},
			continueState: { // 是否显示继续加载的提示  show:显示   hide:隐藏    finish:结束
				type: String,
				required: true,
				default: 'hide'
			},
			type: { // 列表类型  用于空白页展示
				type: String,
				default: 'post',
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.loading {
		padding: 80upx 0;
		text-align: center;
	}

	.empty {
		text-align: center;

		image {
			margin: 0 auto;
			width: 500upx;
			height: 500upx;
		}
	}
</style>
